<%= error_messages_for 'user' %>
<!--[form:user]-->
<!-- all custom fields here -->
	<tr>
		<th><label for="user_email">Email Address</label></th>
		<td><%= text_field 'user', 'email'  %></td>
	</tr>

	<tr>
		<th><h2>Roles</h2></th>
		<td>
<% for role in Role.find(:all) -%> 
  
	<%= "<input id=\"roles_#{role.id}\" type=\"checkbox\" name=\"roles[]\" value=\"#{role.id}\" checked=\"checked\" /> " if @user.roles.include? role %>
    <%= "<input id=\"roles_#{role.id}\" type=\"checkbox\" name=\"roles[]\" value=\"#{role.id}\" /> " unless @user.roles.include? role %>
    <%= "<label for=\"roles_#{role.id}\">#{role.name.titleize}</label><br /> " %>

<% end -%>
		</td>
	</tr>

<!--[eoform:user]-->